<extend name="Public:base" />
<block name="content">
    <form method="post" id="validation-form">
    <table class="table table-striped table-bordered table-hover search-form" id="nav-table">
        <thead>
            <th>电子券号：<input name="name" type="text"  value="{:I('number')}" />
            电子券名称：<input name="name" type="text"  value="{:I('name')}" />
            <a class="btn btn-primary radius5 btn-sm" href="javascript:;" id="search" url="{:U('Coupon/CouponUseCount')}">查询</a>
            </th>
        </thead>
    </table>
    <div class="table-responsive">
        <table class="table table-striped table-bordered table-hover" id="mytable">
            <thead>
            <tr>
                <th>电子券号</th>
                <th class="col-xs-1">电子券名称</th>
                <th>面值</th>
                <th class="col-xs-7">可用范围</th>
                <th>领取数</th>
                <th>使用数</th>
            </tr>
            </thead>
            <tbody>
            <volist name="Coupon" id="vo">
                <tr>
                    <td>{$vo.volume_number}</td>
                    <td>{$vo.volume_name}</td>
                    <td>¥{$vo.total}</td>
                    <td>{$vo.category}</td>
                    <td><a href="{:U('Coupon/GetCouponSendInfo')}/coupon_id/{$vo.volume_id}/scene/get">{$vo.get_count}</a></td>
                    <td><a href="{:U('Coupon/GetCouponSendInfo')}/coupon_id/{$vo.volume_id}/scene/use">{$vo.use_count}</a></td>
                </tr>
            </volist>
            <tr>
                <td colspan="20" class="page">{$page}</td>
            </tr>
            </tbody>

        </table>
    </div>
     </form>
</block>
<block name="javascript">
    <script>
        $(function(){
            $("#search").click(function () {
                var url = $(this).attr('url');
                var query = $('.search-form').find('input,select').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });

        });
    </script>
</block>